#include <iostream>//Complex.cpp
#include "Complex.h"

using namespace std;

Complex::Complex(double a=0,double b=0)
{
    real=a;
    imag=b;
}

void Complex::Input()
{
    cout<<"please input the real part and imaginary part: ";
    cin>>real>>imag;
    cout<<endl;
}

Complex Complex::Add(Complex& c)
{
    return Complex(real+c.real,imag+c.imag);
}

void Complex::Display()
{
    if(imag<0)
        cout<<real<<imag<<'i'<<endl;
    else
        cout<<real<<'+'<<imag<<'i'<<endl;
}
